home *** CD-ROM | disk | FTP | other *** search
- Path: atglab.bls.com!Alun.Champion
- From: Alun.Champion@bridge.bst.bls.com (Alun Champion)
- Newsgroups: comp.lang.c++
- Subject: Re: Help on C++ error
- Date: 11 Jan 1996 15:52:16 GMT
- Organization: Computer People Inc.
- Message-ID: <ALUN.CHAMPION.96Jan11105216@g7240065.bridge.bst.bls.com>
- References: <96010.112507APCCU@CUNYVM.CUNY.EDU> <4d1rqc$sla@oxy.rust.net>
- NNTP-Posting-Host: bstfirewall.bst.bls.com
- In-reply-to: ebennett@rust.net's message of Thu, 11 Jan 1996 05:15:47 GMT
-
- In article <4d1rqc$sla@oxy.rust.net> ebennett@rust.net writes:
-
- : Paul Abrilla <APCCU@CUNYVM.CUNY.EDU> wrote:
-
- :> Hi to all,
- :>
- :> I'm just starting to code on C++, and was playing around with classes and
- :> came across an error and a warning when I try to compile the code below.
- :> The warning is complaining about the statement, 'int Cat::SetAge(age)'.
- :> It says, 'Style of function definition is now obsolete'. I'm sorry I couldn't
- :> check my compiler's manual at this time. On the other hand, the error says,
- :> 'Cat::SetAge(int)' is not a member of 'Cat' (line:19). Any help will be
- :> appreciated. Please send replies directly tp my account. Thanks in advance.
- :>
- :> Stuff Deleted....
- :>
- :> int Cat::SetAge(age)
- :> {
- :> itsAge = age;
- :> }
-
- : Change this to:
-
- : int Cat::SetAge(int age)
- : {
- : itsAge = age;
- : }
-
- : The style of declaring a parameter without its type is obsolete.
-
- The declaration of the function in the class declaration was
- void SetAge(int);
- so void has to be changed to int or vice-versa.
- If you change the declaration then this function needs a return statement.
-
- Regards
-
- -A.
-
-
- --
- | A.Champion |
-